// Jason+ Agent david in project directory.mas2j

{include("dir_commands.asl")}

/* Initial beliefs and rules */

maxHour(11).

/* Initial goals */

!start.

/* Plans */

+!start : true <- 
	.send(directory, askHow, {+!registerIncomingInvoice(_,_,_)[source(_)]});
	.wait(500);
	!!start2.

@start2[atomic]
+!start2 : maxHour(MaxHour) <-
	!registerIncomingInvoice(253,99,21);
	?invoice(253)[record(_,_,_,time(H,M,S))];
	if(H > MaxHour) {.fail};
	.print("The invoice is truly registered at ",H,":",M,":",S,".").
	
-!start2 <-
	.print("The invoice is not registered.").
